revision:
It returns the same as "children.length" and is read only.
Syntax:
element.childElementCount : the number of child elements of the element
property value:
none :
example
First p element
Second p element
<div> <div id="DIV1"> <p>First p element</p> <p>Second p element</p> </div> <p id="prop5"></p> <p id="prop6"></p> </div> <style> #DIV1{background-color: coral;} </style> <script> let numb = document.getElementById("DIV1").childElementCount; document.getElementById("prop5").innerHTML = "number of children in div element : " + numb; let numb1 = document.getElementById("DIV1").children.length; document.getElementById("prop6").innerHTML = "number of children in div element : " + numb; </script>